home *** CD-ROM | disk | FTP | other *** search
- package icontrols;
-
- import com.ms.wd.ui.Brush;
- import com.ms.wd.ui.Graphics;
- import com.ms.wd.ui.Pen;
- import com.ms.wd.ui.Rectangle;
- import com.ms.wd.win32.Windows;
-
- public class BorderDisplayer {
- public static final int BS_SINGLELINE = 1;
- public static final int BS_3DLINE = 2;
- public static final int BS_NONE = 4;
- public static final int BS_SUNKEN = 16;
- public static final int BS_RAISED = 32;
- private int m_nBorderStyle = 18;
-
- public int getBorderHeight() {
- return this.getBorderWidth();
- }
-
- public int getBorderWidth() {
- if ((this.m_nBorderStyle & 2) == 2) {
- return 2;
- } else {
- return (this.m_nBorderStyle & 1) == 1 ? 1 : 0;
- }
- }
-
- public void paintIn(Graphics g, Rectangle bounds, Rectangle clipRect) {
- if ((this.m_nBorderStyle & 4) != 4) {
- if ((this.m_nBorderStyle & 2) == 2) {
- int nStyle = 5;
- if ((this.m_nBorderStyle & 16) == 16) {
- nStyle = 10;
- }
-
- Windows.DrawEdge(g.getHandle(), bounds.toRECT(), nStyle, 15);
- } else {
- g.setBrush((Brush)null);
- g.setPen(Pen.BLACK);
- g.drawRect(bounds);
- }
-
- }
- }
-
- public void setBorderStyle(int nStyle) {
- this.m_nBorderStyle = nStyle;
- }
-
- public int getBorderStyle() {
- return this.m_nBorderStyle;
- }
- }
-